package com.fpd.model.entity;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fpd.enums.CustSourceEnum;
import com.fpd.tools.DateUtil;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description = "回款记录信息模型")
public class MoneyBackRecordInfo {

	private String id;

	@ApiModelProperty(value = "创建时间", example = "", hidden = false)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	@ApiModelProperty(value = "更新时间", example = "", hidden = false)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updateTime;

	@ApiModelProperty(value = "本次还款时间", example = "", hidden = false)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date backTime;

	@ApiModelProperty(value = "取消分期时间", example = "", hidden = false)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date cancelPeriodTime;

	@ApiModelProperty(value = "结款日期", example = "", hidden = false)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date settleTime;

	@ApiModelProperty(value = "合同号", example = "", hidden = false)
	private String contractNumber;

	@ApiModelProperty(value = "回款金额", example = "", hidden = false)
	private BigDecimal backAmount;

	@ApiModelProperty(value = "剩余期款", example = "", hidden = false)
	private BigDecimal leftAmount;

	@ApiModelProperty(value = "累计回款金额", example = "", hidden = false)
	private BigDecimal totalBackAmount;

	@ApiModelProperty(value = "划扣银行", example = "", hidden = false)
	private String bankName;

	@ApiModelProperty(value = "划扣银行卡号", example = "", hidden = false)
	private String bankNumber;

	@ApiModelProperty(value = "代偿人关系", example = "", hidden = false)
	private String payerRelationship;

	@ApiModelProperty(value = "回款方式（1：自然回款；2：催收回款）", example = "", hidden = false)
	private String backType;

	@ApiModelProperty(value = "转化分类（1：当日转化；2：非当日转化；3：其他）", example = "", hidden = false)
	private String conversionClassify;

	@ApiModelProperty(value = "回款状态（0：未确认；1：已确认收款；2：已确认未收款）", example = "", hidden = false)
	private String financeState;

	@ApiModelProperty(value = "跟进客服ID", example = "", hidden = false)
	private String followUserId;

	@ApiModelProperty(value = "已还期数", example = "", hidden = false)
	private String alreadyPeriod;

	@ApiModelProperty(value = "来电回款天数", example = "", hidden = false)
	private String callBackDays;

	@ApiModelProperty(value = "来电与回款周期(0:0天,1:1~5天,2:6~10天,3:11~15,4:16~20天,5:21~25天,6:26~30天,7:31~40天,8:41~50天,9:50天以上)", example = "", hidden = false)
	private String callBackPeriod;

	@ApiModelProperty(value = "帐龄(0:0   1: 0-1年  2: 1-2年  3:2-3年 4:3年以上)", example = "", hidden = false)
	private String aging;

	@ApiModelProperty(value = "委案还款天数", example = "", hidden = false)
	private String repaymentDays;

	@ApiModelProperty(value = "年龄段(1:18~25岁，2：26~35岁，3：36~45岁，4：46岁及以上)", example = "", hidden = false)
	private String agePart;

	@ApiModelProperty(value = "委案还款周期(0:0天,1:1~5天,2:6~10天,3:11~15,4:16~20天,5:21~25天,6:26~30天,7:31~40天,8:41~50天,9:50天以上)", example = "", hidden = false)
	private String repaymentBackPeriod;

	@ApiModelProperty(value = "附件编号", example = "", hidden = false)
	private String attachmentNo;

	@ApiModelProperty(value = "审核状态（0：未通过审核；1：审核中；2：审核通过）")
	private Integer auditState;

	@ApiModelProperty(value = "审核描述")
	private String auditDesc;

	@ApiModelProperty(value = "客户号")
	private String custNo;

	@ApiModelProperty(value = "客户姓名")
	private String custName;

	@ApiModelProperty(value = "客户手机号")
	private String phoneNumber;

	@ApiModelProperty(value = "委托方名称")
	private String entrustName;

	@ApiModelProperty(value = "回款客服姓名")
	private String truename;

	@ApiModelProperty(value = "案件状态（0:未分配，1：已分配，5：回款中；6：回款完成；7:历史记录）")
	private String caseState;

	@ApiModelProperty(value = "附件图片路径")
	private String imagePath;
	
	private String thirdParty;
	
	private String backMonth;
	
	private String custSource;//客户来源
	private String custSourceName;//客户来源名称
	
	public String getBackMonth() {
		return null == this.backTime ? "" : DateUtil.parseDateToStr(this.backTime, DateUtil.DATE_FORMAT_YYYY_MM);
	}
	
	public String getCustSourceName() {
		return CustSourceEnum.getNameByValue(this.custSource);
	}
}